<div class="r0 p10 pt0 col-xs-12" ng-controller="interfaceDetailCtrl">
	<div class="col-xs-12 p0" id="interFaceDetail">
		<form ng-submit="submitForm('module/addOrUpdate.do')"
			ng-if="model.parentId!=null">
			<table class="table table-bordered">
				<tr>
					<td class="tc">名称</td>
					<td class="tc" colspan="3"><input class="form-control" maxlength="50"
						required type="text" ng-model="model.moduleName"></td>
				</tr>
				<tr>
					<td class="tc">访问密码</td>
					<td class="tc" colspan="3"><input class="form-control"
						type="text" ng-model="model.password" placeholder="可选，私密项目请设置密码"></td>
				</tr>
				<tr>
					<td class="tc">排序</td>
					<td class="tc" colspan="3">
					<input class="form-control" min="0" max="10000" required type="number" ng-model="model.sequence"></td>
				</tr>
			</table>
			<button type="submit" class="btn btn-success fr">提交</button>
		</form>

		<form ng-submit="submitForm('interface/addOrUpdate.do')"
			ng-if="model.moduleId!=null&&model.parentId==null">
			<table class="table table-bordered">
				<tr>
					<td class="tc w80">接口名称</td>
					<td class="tc w400"><input class="form-control" type="text" required maxlength="50"
						ng-model="model.interfaceName" placeholder="示例：获取订单列表接口"></td>
					<td>模块名</td>
					<td><input type="text"  class="form-control" value="{{model.moduleName}}" readonly></td>
				</tr>
				<tr>
					<td class="tc">URL</td>
					<td class="tc" colspan="3"><input class="form-control"
						type="text" ng-model="model.url" required maxlength="100"
						placeholder="示例：http://api.crap.cn/CustomerOrder/GetMyOrderList">
					</td>
				</tr>
				<tr>
					<td class="tc w80">请求方式</td>
					<td class="tc">
						<input class="form-control cursor" type="text" id="method" placeholder="请点击输入框选择" required ng-model="model.method"
							ng-focus="loadPickByName('iwidth=220|iheight=250|tag=method|code=REQUESTMETHOD|def='+model.method,$event)">
					</td>
					<td class="tc">状态</td>
					<td>
						<input class="form-control" type="text" id="status"
							ng-focus="loadPick($event,220,220,'true','status','INTERFACESTATUS','',model.status);"
								ng-model="model.status" required placeholder="请点击输入框选择">
					</td>
				</tr>
				<tr>
					<td class="tc w80">版本号</td>
					<td class="tc"><input class="form-control" type="text"
						ng-model="model.version" required></td>
					<td>排序</td>
					<td class="tc">
					<input class="form-control" min="0" max="10000" required type="number" ng-model="model.sequence"></td>
				</tr>
				<tr>
					<td class="tc">参数</td>
					<td class="tc" colspan="3">
						<div id="eparam" class="none">
							<table class="table table-hover" id="editParamTable">
								<thead>
									<tr class="btn-purple">
										<th>名称</th>
										<th>是否必须</th>
										<th>类型</th>
										<th>参数来源</th>
										<th>备注</th>
										<th class="w50">操作</th>
									</tr>
								</thead>
								<tbody>
								</tbody>
							</table>
							<button type="button"
								ng-click="modifyParam('eparam','param',model,'param')"
								class="btn btn-warning fr ml10">提交修改</button>
							<button type="button"
								onclick="addOneParam('','','','','','','editParamTable')"
								class="btn btn-success fr ml10">添加</button>
							<button type="button" onclick="goJsonPage('eparam','param')"
								class="btn btn-primary fr">返回</button>
						</div>
						<div class="input-group w" id="param">
							<textarea class="form-control no-resize" ng-model="model.param"
								rows="6" readonly placeholder="请点击“编辑”按钮编辑参数"></textarea>
							<div class="input-group-addon cursor btn-purple"
								ng-click="editerParam('eparam','param',model,'editParamTable');">
								编辑</div>
						</div>
					</td>
				</tr>
				<tr>
					<td class="tc">返回参数</td>
					<td class="tc" colspan="3">
						<div id="responseEparam" class="none">
							<table class="table table-hover" id="editResponseParamTable">
								<thead>
									<tr class="btn-purple">
										<th>名称</th>
										<th>类型</th>
										<th>备注</th>
										<th class="w50">操作</th>
									</tr>
								</thead>
								<tbody>
								</tbody>
							</table>
							<button type="button"
								ng-click="modifyParam('responseEparam','responseParam',model,'responseParam')"
								class="btn btn-warning fr ml10">提交修改</button>
							<button type="button"
								onclick="addOneParam('','','','','','','editResponseParamTable')"
								class="btn btn-success fr ml10">添加</button>
							<button type="button"
								onclick="goJsonPage('responseEparam','responseParam')"
								class="btn btn-primary fr">返回</button>
						</div>
						<div class="input-group w" id="responseParam">
							<textarea class="form-control no-resize"
								ng-model="model.responseParam" rows="6" readonly
								placeholder="请点击“编辑”按钮编辑返回参数"></textarea>
							<div class="input-group-addon cursor btn-purple"
								ng-click="editerParam('responseEparam','responseParam',model,'editResponseParamTable');">
								编辑</div>
						</div>

					</td>
				</tr>
				<tr>
					<td class="tc">接口说明</td>
					<td class="tc" colspan="3"><div text-angular="text-angular"
							class="tl" ng-model="model.remark"></div></td>
				</tr>
				<tr>
					<td class="tc">正确返回示例<br> <input type="button"
						class="btn btn-default btn-sm" value="格式化数据"
						ng-click="setValueForModel('trueExam',true)">
					</td>
					<td class="tc"><textarea class="form-control no-resize"
							id="trueExam" ng-model="model.trueExam" rows="10"
							placeholder='请用标准json结构
示例：	{
			"success": 1,			
			"data": {
				"num": 15 		
			},
			"error": 
			{
				"message":null, 	
				"code":null, 		
				"data":null
			}
		}'></textarea>
					</td>
					<td class="tc">错误返回示例<br> <input type="button"
						class="btn btn-default btn-sm" value="格式化数据"
						ng-click="setValueForModel('falseExam',true)"></td>
					<td class="tc"><textarea class="form-control no-resize"
							id="falseExam" ng-model="model.falseExam" rows="10"
							placeholder='请用标准json结构
示例：	{
			"success": 0,
			"error": {
				"code": 错误码,
				"data": {},
				"message": " error message"
			}
		}'></textarea></td>
				</tr>
				<tr>
					<td class="tc">请求示例<br> <input type="button"
						class="btn btn-default btn-sm" value="自动生成"
						ng-click="getRequestExam()">
					</td>
					<td class="tc"><textarea class="form-control no-resize"
							ng-model="model.requestExam" rows="5"
							placeholder='示例：
请求地址：
	http://api.biyao.com
请求参数：
	name=xxx
请求头：
	uid=xxx'></textarea>
					</td>
					<td class="tc">错误列表</td>
					<td class="tc">
						<div class="input-group w">
							<textarea class="form-control no-resize" id="errorList"
								placeholder="请点击“选择”按钮选择错误码
键盘输入可快速定位错误码
退格键可删除输入"
								ng-model="model.errorList" rows="5" readonly></textarea>
							<div class="input-group-addon cursor btn-purple"
								ng-click="loadPick($event,300,400,'false','errorList','ERRORCODE','',model.errorList,'&key='+model.moduleId,0);">
								选择</div>
						</div>
					</td>
				</tr>

			</table>
			<button type="submit" class="btn btn-success fr">提交</button>
		</form>
	</div>
	<div class="col-xs-12 p0 mt10 none" id="copyInterFace">
		<form ng-submit="submitForm('interface/copy.do')">
			<input class="form-control mb10" type="text"
							ng-model="model.interfaceName" placeholder="示例：获取订单列表接口" required>
			<input class="form-control mb10"
							type="text" ng-model="model.url" required
							placeholder="示例：http://api.biyao.com/CustomerOrder/GetMyOrderList">
			<input  class="form-control mb10" id="moduleName" type="text" ng-model="model.moduleName" required placeholder="点击输入框选择模块"
					ng-focus="loadPickByName('iwidth=220|iheight=320|tagName=moduleName|tag=moduleId|code=LEAFMODULE|def='+model.moduleId,$event)">
			<button type="submit" class="btn btn-purple fr">拷贝</button>
		</form>
	</div>
	
</div>
<div class="cb"></div>

